package xc.com.diy.view;

import xc.com.diy.listener.f;
import xc.com.diy.listener.g;

import com.example.xiaocongtv.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

public class TagScrollView extends FrameLayout {
	private Animation b;
	private Animation c;
	private boolean d;

	public TagScrollView(Context paramContext) {
		this(paramContext, null);
	}

	public TagScrollView(Context paramContext, AttributeSet paramAttributeSet) {
		this(paramContext, paramAttributeSet, 0);
	}

	public TagScrollView(Context paramContext, AttributeSet paramAttributeSet,
			int paramInt) {
		super(paramContext, paramAttributeSet, paramInt);
		d();
	}

	private void d() {
		this.b = AnimationUtils.loadAnimation(getContext(), R.anim.tag_expand);
		this.b.setAnimationListener(new f(this));
		this.c = AnimationUtils
				.loadAnimation(getContext(), R.anim.tag_collapse);
		this.c.setAnimationListener(new g(this));
		new LinearLayout(getContext());
	}

	public void a() {
		if (!d) {
			clearAnimation();

		} else {
			this.d = false;
			startAnimation(this.c);
		}

	}

	public void a(int paramInt) {
		View localView = LayoutInflater.from(getContext()).inflate(
				R.layout.layout_scanning, null);
		;
		removeAllViews();
		if (paramInt == 1) {
			localView = LayoutInflater.from(getContext()).inflate(
					R.layout.layout_scanning, null);
		} else {
			if (paramInt == 2) {
				localView = LayoutInflater.from(getContext()).inflate(
						R.layout.layout_scanning_failure_wifi, null);

			} else {
				localView = LayoutInflater.from(getContext()).inflate(
						R.layout.layout_scanning_failure_connect, null);
			}
		}
		addView(localView);

	}

	public void b() {
		if (d) {
			clearAnimation();

		} else {
			this.d = true;

			startAnimation(this.b);

		}

	}

	public boolean c() {
		return this.d;
	}

	public void setOutsideTouchable(boolean e) {
		// TODO Auto-generated method stub

	}
}